home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20031118-20041115 / 000397_dm_v_2000@yahoo.com_Tue Sep 21 17:46:25 2004.msg < prev    next >
Internet Message Format  |  2020-01-01  |  2KB

  1. Path: newsmaster.cc.columbia.edu!newsfeed1.nycmny01.us.to.verio.net!newspeer1.stngva01.us.to.verio.net!verio!news.tele.dk!news.tele.dk!small.news.tele.dk!news.glorb.com!postnews1.google.com!not-for-mail
  2. From: dm_v_2000@yahoo.com (Peter V.)
  3. Newsgroups: comp.protocols.kermit.misc
  4. Subject: Return codes and If statments
  5. Date: 21 Sep 2004 13:52:08 -0700
  6. Organization: http://groups.google.com
  7. Lines: 41
  8. Message-ID: <3f9c05b0.0409211252.5aa51cb1@posting.google.com>
  9. NNTP-Posting-Host: 206.6.159.100
  10. Content-Type: text/plain; charset=ISO-8859-1
  11. Content-Transfer-Encoding: 8bit
  12. X-Trace: posting.google.com 1095799928 24642 127.0.0.1 (21 Sep 2004 20:52:08 GMT)
  13. X-Complaints-To: groups-abuse@google.com
  14. NNTP-Posting-Date: Tue, 21 Sep 2004 20:52:08 +0000 (UTC)
  15. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:15174
  16.  
  17. Hello,
  18.  
  19.  
  20.   I am modifying a C-Kermit script I have to not continue processing
  21. if a call to another script does not return a value of 1 (We are doing
  22. this for fail over testing).
  23.  
  24. Here is the C-Kermit code in question:
  25.  
  26. # run the db_status script in the CRON directory
  27. run db_status
  28.  
  29. # See if the ret value is != 1
  30. #  If it != 1 tell user we are not on the primay server and then
  31. exit).
  32.  
  33. if != \v(pexitstat) 1 
  34.  { 
  35.    echo Return code != 1 ... Not the primary server
  36.    echo return code =  \v(pexitstat)
  37.    exit
  38.  
  39.   }
  40. # otherwise we are on the primary server so continue processing
  41. ...
  42. ...
  43. ...
  44.  
  45. When I run this on the Secondary server it works (since the result
  46. returned from the db_status script is a 2 since it is not the primary
  47. server).
  48.  
  49. However, when I test this on the primay server the code exits (meaning
  50. it executes the body of the if statment above) despite the fact that
  51. the return code from db_status is 1.
  52.  
  53. Any suggestions, as to what I'm doing wrong?
  54.  
  55. Many thanks in advance
  56.  
  57. Peter Vasseur